#ifndef CHOOSERWIDGET_H
#define CHOOSERWIDGET_H

#include <QStackedWidget>
#include <QtSql>
#include "rightclickablebutton.h"

namespace Ui {
    class ChooserWidget;
}

struct TaskComponents
{
    QString themeEN;
    QString themeHU;
    bool isTrueOrFalse;
    QList<int> correctAnswerIDs;
    QString question;
    QStringList answers;
};

class ChooserWidget : public QStackedWidget
{
    Q_OBJECT

public:
    explicit ChooserWidget(QWidget *parent = 0);
    ~ChooserWidget();
private slots:
    void settingsReloadFromMainSlot();
    void on_pushButtonCloseInGame_clicked();
    void chooseButtonsClicked();
    void chooseButtonsRightClicked();

    void on_pushButtonClose_clicked();

    void on_commandLinkButtonStartMixer_clicked();

    void on_pushButton_ChangeMode_clicked();

    void on_pushButton_EditThemes_clicked();

    void on_pushButton_Next_clicked();

    void on_pushButton_EditSentences_clicked();

    void on_pushButton_EditDictionary_clicked();

    void on_radioButton_Dictionary_toggled(bool checked);

private:
    void startpanelFill();
    void updateStatisticDisplays();
    void clearDisplayCounters();
    void startNewTask(int currentID = 0);
    void getNewTask(TaskComponents &, int currentID=0);
    void endGame();
    Ui::ChooserWidget *ui;
    QList<RightClickableButton *> buttonsList;
    QList<RightClickableButton *> correctButtonsList;
    int numberofSumTasks;
    int countDone;
    int countFalse;
    QList<int> tasksIdList;
    int currentListIndex;
    int currentTaskID;
    int currentButtonsAvailable;
    bool currentTaskIsOnlyTrue;
    QSqlQueryModel model, themeSqlModel;
    bool isInGame;
};

#endif // CHOOSERWIDGET_H
